-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding blank page for fallback #1441
Conversation
|
@prateekbh this is great. One thing I was thinking: it would be amazing if we could check for the fallback URL (or something like |
Yes that sounds great! I'll make those changes |
@developit done 👍 |
@@ -154,7 +171,11 @@ class PrerenderDataExtractPlugin { | |||
this.data_ = JSON.stringify(cliData.preRenderData || {}); | |||
} | |||
apply(compiler) { | |||
compiler.hooks.emit.tap('PrerenderDataExtractPlugin', compilation => { | |||
compiler.hooks.emit.tap('PrerenderDataExtractPlugin', (compilation) => { | |||
if (this.location_ === `${PREACT_FALLBACK_URL}/`) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we still need this with the custom 200 option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this makes sure that the fallback page has no pre-render data.
Thus in this case the pre-render data will always rely on the current URL .
Co-authored-by: Leah <github.leah@hrmny.sh>
What kind of change does this PR introduce?
Creates a non SSRed html file for caching in service worker. All failed requests would go to this page and the app would render from here
Did you add tests for your changes?
Yes
Summary
Currently we pre-cache all the index.html files of the application. Given the size of the app, these can be many. In order to avoid this we will now create a non ssred version of homepage and upon error will use that to bootstrap the app.
Does this PR introduce a breaking change?
No